//* unpack boost::tuple by using boost::tie()
#include <boost/tuple/tuple.hpp> 
#include <boost/tuple/tuple_io.hpp> 
#include <string> 
#include <iostream> 
 
boost::tuple<std::string, int> func()
{
    return boost::make_tuple("Error message", 2012);
}
 
int main()
{
    std::string errmsg;
    int errcode;
 
    boost::tie(errmsg, errcode) = func(); //unpack boost::tuple
    std::cout << errmsg << " : " << errcode << std::endl;
}